const url = require("url");

var urlobj = url.parse("http://nodejs.cn/api/url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost");

console.log(urlobj);